package com.three.lab.adapter;

import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.three.lab.R;
import com.three.lab.bean.FollowBean;

import java.util.List;

public class FollowListAdapter extends BaseQuickAdapter<FollowBean, BaseViewHolder> {

    public FollowListAdapter( @Nullable List<FollowBean> data) {
        super(R.layout.item_list_follow, data);
    }

    public FollowListAdapter() {
        super(R.layout.item_list_follow);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, FollowBean item) {

        helper.setText(R.id.tv_name,item.getName())
                .setText(R.id.tv_location,item.getLocation())
                .setText(R.id.tv_des,item.getIntro());
        ImageView imageView = helper.getView(R.id.iv_picture);
        Glide.with(mContext).load(item.getProduceUrl()).placeholder(R.mipmap.ic_avatar_52).diskCacheStrategy(DiskCacheStrategy.ALL).skipMemoryCache(false).into(imageView);
    }
}
